// SKU模块接口管理
import request from "@/utils/request"
import type {SkuResponseData,SkuInfoData} from './type'
// 枚举地址
enum API{
  SKU_API='/admin/product/list/',
  SALE_URL='/admin/product/onSale/',
  CANCELSALE_URL='/admin/product/cancelSale/',
  SKUINFO_URL='/admin/product/getSkuInfo/',
  DELETE_URL='/admin/product/deleteSku/'
}
// 获取商品SKU的接口
export const reqSkuList = (page:number,limit:number)=>request.get<any,SkuResponseData>(API.SKU_API+`${page}/${limit}`)
// 商品上架
export const reqSaleSku = (skuId:number)=>request.get<any,any>(API.SALE_URL+skuId)
// 商品下架
export const reqCancelSale = (skuId:number)=>request.get<any,any>(API.CANCELSALE_URL+skuId)
// 商品详情
export const reqSkuInfo = (skuId:number)=>request.get<any,SkuInfoData>(API.SKUINFO_URL+skuId)
// 删除商品
export const reqRemoveSku = (skuId:number)=>request.delete<any,any>(API.DELETE_URL+skuId)
